feat: add schema versioning to registry index and pack metadata#3
Merged
Conversation
Add forward-compatible schema versioning to all generated registry files:
- index.json now uses envelope format: {"schema_version": 1, "packs": {…}}
- Each packs/{name}.json includes a top-level schema_version field
- generate.py emits REGISTRY_SCHEMA_VERSION (currently 1) in both formats
This enables older weave clients to detect and reject registry formats
they cannot safely parse, displaying a clear "please upgrade" message.
Companion to breferrari/weave#237.
6 tasks
There was a problem hiding this comment.
Pull request overview
Adds explicit schema versioning to the generated registry artifacts so clients can detect (and error on) unsupported registry formats, enabling safer forward compatibility.
Changes:
- Emit
schema_version: 1in each generatedpacks/{name}.json. - Change
index.jsonto an envelope format:{"schema_version": 1, "packs": { ... }}. - Update
scripts/generate.pyto centralize the schema version viaREGISTRY_SCHEMA_VERSION.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/generate.py | Introduces REGISTRY_SCHEMA_VERSION and updates pack + index generation to emit schema versioned outputs. |
| index.json | Switches to schema-versioned envelope with packs payload. |
| packs/brave-search.json | Adds top-level schema_version. |
| packs/docs-writer.json | Adds top-level schema_version. |
| packs/fetch.json | Adds top-level schema_version. |
| packs/filesystem.json | Adds top-level schema_version. |
| packs/git-tools.json | Adds top-level schema_version. |
| packs/github.json | Adds top-level schema_version. |
| packs/memory.json | Adds top-level schema_version. |
| packs/postgres.json | Adds top-level schema_version. |
| packs/python-dev.json | Adds top-level schema_version. |
| packs/rust-dev.json | Adds top-level schema_version. |
| packs/sequential-thinking.json | Adds top-level schema_version. |
| packs/sqlite.json | Adds top-level schema_version. |
| packs/web-dev.json | Adds top-level schema_version. |
Comments suppressed due to low confidence (1)
scripts/generate.py:13
- The module docstring still describes index.json being regenerated "as a flat catalog" with latest_version entries. Since regenerate_index() now emits an envelope with {schema_version, packs}, this description is now inaccurate and should be updated to match the new on-disk format.
1. Reads all files and builds an inline `files` map (relative path -> content).
2. Parses pack.toml to extract metadata (version, description, authors, etc.).
3. Writes packs/{name}.json — creating it or updating the version entry in place.
Then regenerates index.json as a flat catalog of all packs with latest_version
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
schema_version: 1toindex.json(envelope format:{"schema_version": 1, "packs": {…}})schema_version: 1to eachpacks/{name}.jsonas a top-level fieldscripts/generate.pyto emitREGISTRY_SCHEMA_VERSION(currently 1) in all generated filesThis enables forward compatibility: older weave clients can detect registry formats they cannot safely parse and display a clear "please upgrade weave" error instead of silently misinterpreting data.
Companion PR
Test plan
generate.pyruns successfully and regenerates all 13 packs + indexindex.jsonhas correct envelope structure withschema_version: 1packs/{name}.jsonincludesschema_version: 1as first field